<extend name="Public:comment" />

<block name="title">管理收货地址</block>

<block name="css">
	<link rel="stylesheet" href="/Application/Home/Common/css/base.css" type="text/css" />
	<link rel="stylesheet" href="/Application/Home/Common/css/shop_common.css" type="text/css" />
	<link rel="stylesheet" href="/Application/Home/Common/css/shop_header.css" type="text/css" />
	<link rel="stylesheet" href="/Application/Home/Common/css/shop_manager.css" type="text/css" />
	<link rel="stylesheet" href="/Application/Home/Common/css/shop_shdz_835.css" type="text/css" />
</block>

<block name="js">
	<script type="text/javascript" src="/Application/Home/Common/js/jquery.js" ></script>
    <script type="text/javascript" src="/Application/Home/Common/js/topNav.js" ></script>
    <script type="text/javascript">
	jQuery(function(){
		jQuery("#new_add_shdz_btn").toggle(function(){
			jQuery("#new_add_shdz_contents").show(500);
		},function(){
			jQuery("#new_add_shdz_contents").hide(500);
		});
	});
	</script>
</block>

<block name="shouye">
	<div id="shop_hd_menu_all_category" class="shop_hd_menu_all_category"><!-- 首页去掉 id="shop_hd_menu_all_category" 加上clsss shop_hd_menu_hover -->
</block>

<block name="content">
	<!-- 面包屑 注意首页没有 -->
	<div class="shop_hd_breadcrumb">
		<strong>当前位置：</strong>
		<span>
			<a href="{:U('Index/index')}">首页</a>&nbsp;›&nbsp;
			<a href="{:U('User/member')}">我的商城</a>&nbsp;›&nbsp;
			<a href="{:U('User/member')}">已买到商品</a>
		</span>
	</div>
	<div class="clear"></div>
	<!-- 面包屑 End -->

	<!-- Header End -->	

	<!-- 我的个人中心 -->
	<div class="shop_member_bd clearfix">
		<!-- 左边导航 -->
		<div class="shop_member_bd_left clearfix">
			
			<div class="shop_member_bd_left_pic">
				<a href="javascript:void(0);"><img src="/Application/Home/Common/images/avatar.png" /></a>
			</div>
			<div class="clear"></div>

			<dl>
				<dt>我的交易</dt>
				<dd><span><a href="{:U('member')}">已购买商品</a></span></dd>
				<dd><span><a href="{:U('Index/favorite')}">我的收藏</a></span></dd>
				<dd><span><a href="{:U('estimate')}">评价管理</a></span></dd>
			</dl>

			<dl>
				<dt>我的账户</dt>
				<dd><span><a href="{:U('member_info')}">个人资料</a></span></dd>
				<dd><span><a href="{:U('password_edit')}">密码修改</a></span></dd>
				<dd><span><a href="{:U('address')}">收货地址</a></span></dd>
			</dl>

		</div>
		<!-- 左边导航 End -->
		
		<!-- 右边购物列表 -->
		<div class="shop_member_bd_right clearfix">
			
			<div class="shop_meber_bd_good_lists clearfix">
				<div class="title"><h3>管理收货地址<a style="float:right;" href="javasrcipt:void(0);" id="new_add_shdz_btn">新增收货地址</a></h3></div>
				<div class="clear"></div>
			<!-- 收货人地址 Title End -->
			<div class="shop_bd_shdz clearfix">
				<div class="shop_bd_shdz_lists clearfix">
					<ul>
					<foreach name="res" item="v">
						<li><label><span><input type="radio" name="shdz" /></span></label><em>{$v.address1}</em><em>{$v.address2}</em><em>{$v.address3}</em><em>{$v.address}</em><em>{$v.name}(收)</em><em>{$v.mobel_phone}</em><span class="admin_shdz_btn"><a href="{:U('address_update',array('id'=>$v['id']))}">编辑</a><a href="{:U('address_delete',array('id'=>$v['id']))}">删除</a></span></li>
					</foreach>
					</ul>
				</div>
				<!-- 新增收货地址 -->
				<div id="new_add_shdz_contents" class="shop_bd_shdz_new clearfix" id="new_address" style="display:none;">
					<div class="title">新增收货地址</div>
					<div class="shdz_new_form">
						<form action="" method="post">
							<ul>
								<li><label for=""><span>*</span>收货人姓名：</label><input type="text" name="name" class="name" /></li>
								<li><label for=""><span>*</span>所在地址：</label>
									<select name="address1" class="select1">
											<option value="">请选择</option>
										<foreach name="placename" item="v">
											<option value="{$v['id']}">{$v.name}</option>
										</foreach>
									</select>
									<select name="address2" class="select2">
											<option value="">请选择</option>
										<foreach name="placename2" item="v">
											<option value="{$v['id']}">{$v.name}</option>
										</foreach>
									</select>
									<select name="address3" class="select3">
											<option value="">请选择</option>
										<foreach name="placename3" item="v">
											<option value="{$v['id']}">{$v.name}</option>
										</foreach>
									</select>
								</li>
								<li><label for=""><span>*</span>详细地址：</label><input type="text" name="address" class="xiangxi" /></li>
								<li><label for=""><span></span>邮政编码：</label><input type="text" name="postalcode" class="youbian" /></li>
								<li><label for=""><span></span>电话：</label><input type="text" name="phone" class="dianhua" /></li>
								<li><label for=""><span></span>手机号：</label><input type="text" name="mobel_phone" class="shouji" /></li>
								<li><label for="">&nbsp;</label><input type="submit" value="添加收货地址" /></li>
							</ul>
						</from>
					</div>
				</div>
				<!-- 新增收货地址 End -->
			</div>
			<div class="clear"></div>
			</div>
		</div>
		<!-- 右边购物列表 End -->

	</div>
	<!-- 我的个人中心 End -->
	<script type="text/javascript">
		$(function(){
			$(".select1").change(function(){
				var fid = $(this).val();
				console.log(fid);
				$.ajax({
					type:"get",
					url:"{:U('User/placename')}",
					data:{fid:fid},
					success:function(msg){
						if(msg.status==1){
							$(".select2").html("");
							$(".select2").append(msg.data);
						}
					}
				});
			});

			$(".select2").change(function(){
				var fid = $(this).val();
				console.log(fid);
				$.ajax({
					type:"get",
					url:"{:U('User/placename3')}",
					data:{fid:fid},
					success:function(msg){
						if(msg.status==1){
							$(".select3").html("");
							$(".select3").append(msg.data);
						}
					}
				});
			});
		});
	</script>
</block>